#!bin/bash
m="$(jvavc -version 2>&1 | grep 1.8)"
if [""="$m"];
then
    echo "No JDK"
    echo "JDK 1.8 is install"
    cd /usr/local
    sudo su
    wget http://download.bell-sw.com/java/8u292+10/bellsoft-jdk8u292+10-linux-amd64-full.tar.gz
    mkdir -p java
    mv bellsoft-jdk8u292+10-linux-amd64-full.tar.gz /usr/local/java
    tar -zxf bellsoft-jdk8u292+10-linux-amd64-full.tar.gz
    rm bellsoft-jdk8u292+10-linux-amd64-full.tar.gz
    chmod 777 /etc/profile
    echo >> /etc/profile
    echo "JAVA_HOME=/usr/local/java/jdk1.8.0_291">>etc/profile
    echo "JRE_HOME=${JAVA_HOME}/jre">>etc/profile
    echo "CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib">>etc/profile
    echo "PATH=${JAVA_HOME}/bin:$PATH">>etc/profile
    source /etc/profile
else
    echo"JDK1.8 in your computer"
fi

